{% extends "base.html" %}
{% load thumbnail %}

{%block title%}
{{u.username}} Profile
{%endblock%}

{% block content %}
<h1>Userprofile: {{u.username}}</h1> 
Member since: {{u.date_joined}}<br>
{%if u.id == user.id%}
<a href='/profile/edit/'>Edit Profile</a> - <a href='/accounts/password_change/'>Change Password</a><br><br>
{%endif%}<br>
<div class = 'profile'>
<table>
{%if u.id == user.id%}
<tr>
<td><b>First Name:</b></td><td><div class='profile-inner'>{{u.first_name}}</div></td>
</tr>
<tr>
<td><b>Last Name:</b></td><td><div class='profile-inner'>{{u.last_name}}</div></td>
</tr>
<tr>
<td><b>E-Mail:</b></td><td><div class='profile-inner'>{{u.email}}</div></td>
</tr>
<tr>
{%endif%}
<td><b>Website:</b></td><td><div class='profile-inner'><a href='{{u.profile.website}}' target=_new>{{u.profile.website}}</a></div></td>
</tr>
<tr>
<td><b>Biography:</b></td><td><div class='profile-inner'>{{u.profile.biography|linebreaksbr}}</div></td>
</tr>
</table>
</div>
<br>
<h2>Social:</h2>

<div class='profile'>
<table>
<tr><td><b>Twitter:</b></td><td><div class='profile-inner'><a href='{{u.profile.twitter}}' target=_new>{{u.profile.twitter}}</a></div></td>
<td><b>Vimeo:</b></td><td><div class='profile-inner'><a href='{{u.profile.vimeo}}' target=_new>{{u.profile.vimeo}}</a></div></td>
</tr>
<tr><td><b>Youtube:</b></td><td><div class='profile-inner'><a href='{{u.profile.youtube}}' target=_new>{{u.profile.youtube}}</a></div></td>
<td><b>Facebook:</b></td><td><div class='profile-inner'><a href='{{u.profile.facebook}}' target=_new>{{u.profile.facebook}}</a></div></td></tr>
<tr>
<td><b>Blender Artists:</b></td><td><div class='profile-inner'><a href='{{u.profile.blenderartists}}' target=_new>{{u.profile.blenderartists}}</a></div></td>
<td></td><td></td></tr>
</table>
</div>

<br>
<h2>Addons:</h2>
<div class='profile'>

{% if addon_list%}
{% for addon in addon_list%}
<div class = 'profile-inner'>
<table>
<tr><td style='width: 250px;'>

{% thumbnail addon.addon_image "1024" crop="center" as im %}
		<a href='{{ im.url }}' rel='lightbox'>
		{% thumbnail addon.addon_image "200" crop="center" as im %}
		    <img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}" style="box-shadow:4px 4px 4px #666;">
		{% endthumbnail %}
		</a>
		{% endthumbnail %}

</td>
<td><b><a href="/addons/{{addon.id}}">{{addon.addon_name}}</a></b><br>{{addon.addon_description}}</td>
</tr>
</table>
</div><br>
{%endfor%}
{%else%}
<center>
There are no addons from this user
{%if u.id == user.id%}<br>
<a href="/addons/upload/">Upload</a> a new Addon
</center>
{%endif%}
{%endif%}

</div>

{%endblock%}

